package bold.storage.util;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.stream.Collectors;

public class ID implements Serializable {
    private static final long serialVersionUID = -7720584186516351071L;
    private static AtomicInteger atomic;
    public static ID instance;

    private ID() {
    }

    static {
        instance = new ID();
        atomic = new AtomicInteger(0);
    }

    public Long getLong() {
        return Long.valueOf(this.get());
    }

    public String get() {
        if (atomic.intValue() >= 999) {
            try {
                Thread.sleep(1L);
            } catch (InterruptedException var3) {
                var3.printStackTrace();
            }
            atomic.set(0);
        }
        return System.currentTimeMillis() + String.format("%03d", atomic.incrementAndGet());
    }
}

